package com.example.bbs.controller;


import com.example.bbs.entity.Doctor;
import com.example.bbs.service.DoctorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.print.Doc;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author jiaziyun
 * @since 2021-04-30
 */
@Controller
@RequestMapping("/doctor")
public class DoctorController {

    @Autowired
    private DoctorService doctorService;

    @RequestMapping("/certif_doc_by_id")
    @ResponseBody
    public String certifDocById(@RequestBody Doctor doctor) {
        System.out.println("进行申请");
        if (doctor != null) {
            return doctorService.certifDocById(doctor);
        }
        return "500";
    }

    @RequestMapping("/update_doc_by_id")
    @ResponseBody
    public String updateDocById(@RequestBody Doctor doctor) {
        if (doctor != null) {
            return doctorService.updateDocById(doctor);
        }
        return "500";
    }
}
